package com.dengqi.mymodule.activity.network;

import android.content.Context;

import com.dengqi.mymodule.activity.network.bean.MemberBean;
import com.dengqi.mymodule.activity.network.module.MemberPresenter;
import com.module.retrofit.utils.CacheUtil;
import com.trello.rxlifecycle2.components.support.RxAppCompatActivity;

import java.util.List;

/**
 * @Author: dengqi
 * @CreateDate: 2020/10/21 14:59
 * @Description:
 */
public class Helper {

    private Context mContext;
    private MemberPresenter memberPresenter;
    private List<MemberBean.LevelListBean> levelList;

    public Helper(RxAppCompatActivity content) {
        this.mContext = content;
        memberPresenter = new MemberPresenter(content);
    }

    public void init(){
        levelList = (List<MemberBean.LevelListBean>) CacheUtil.getFieldAsObject("level");
        if(levelList == null){
//            memberPresenter.getMemberLevelList(new MemberContract.MemberLevelListView() {
//                @Override
//                public String getBusId() {
//                    return "1";
//                }
//
//                @Override
//                public String getShopId() {
//                    return "1";
//                }
//
//                @Override
//                public void onMemberLevelList(List<MemberBean.LevelList> result) {
//                    CacheUtil.saveField("level", result);
//                }
//            });
        }
    }

}
